// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.imsl.finance;

import java.util.GregorianCalendar;

// Referenced classes of package com.imsl.finance:
//            BasisPart, BasisPartActual

class BasisPart365
    implements BasisPart
{

    BasisPart365()
    {
    }

    public int daysBetween(GregorianCalendar gregoriancalendar, GregorianCalendar gregoriancalendar1)
    {
        int i = gregoriancalendar.get(5);
        int j = gregoriancalendar.get(2);
        int k = gregoriancalendar.get(1);
        int l = gregoriancalendar1.get(5);
        int i1 = gregoriancalendar1.get(2);
        int j1 = gregoriancalendar1.get(1);
        int k1 = BasisPartActual.getNumDays(i, j, k);
        int l1 = BasisPartActual.getNumDays(l, i1, j1);
        int i2 = l1 - k1;
        int j2;
        if(gregoriancalendar.isLeapYear(k))
            j2 = BasisPartActual.getNumDays(29, 1, k) + 2;
        else
            j2 = BasisPartActual.getNumDays(28, 1, k) + 2;
        int k2;
        if(gregoriancalendar1.isLeapYear(j1))
            k2 = BasisPartActual.getNumDays(29, 1, j1) + 2;
        else
            k2 = BasisPartActual.getNumDays(28, 1, j1) + 2;
        if(j2 <= k1 && k2 <= l1)
        {
            for(int l2 = k + 1; l2 <= j1; l2++)
                if(gregoriancalendar.isLeapYear(l2))
                    i2--;

        }
        if(j2 <= k1 && k2 > l1)
        {
            for(int i3 = k + 1; i3 <= j1 - 1; i3++)
                if(gregoriancalendar.isLeapYear(i3))
                    i2--;

        }
        if(j2 > k1 && k2 <= l1)
        {
            for(int j3 = k; j3 <= j1; j3++)
                if(gregoriancalendar.isLeapYear(j3))
                    i2--;

        }
        if(j2 > k1 && k2 > l1)
        {
            for(int k3 = k; k3 <= j1 - 1; k3++)
                if(gregoriancalendar.isLeapYear(k3))
                    i2--;

        }
        return i2;
    }

    public int getDaysInYear(GregorianCalendar gregoriancalendar, GregorianCalendar gregoriancalendar1)
    {
        return 365;
    }

    public double daysInPeriod(GregorianCalendar gregoriancalendar, int i)
    {
        return 365D / (double)i;
    }
}
